package com.tencent.wxcloudrun.controller.zuke;

import com.tencent.wxcloudrun.config.ApiResponse;
import com.tencent.wxcloudrun.pojo.dto.resp.GetBillDetailResp;
import com.tencent.wxcloudrun.pojo.dto.resp.GetBillListResp;
import com.tencent.wxcloudrun.pojo.dto.resp.GetSumBillResp;
import com.tencent.wxcloudrun.service.business.zuke.BillSeeService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/billSee")
public class BillSeeController {

    @Resource
    private BillSeeService billSeeService;

    /**
     * 租客账单查看列表
     */
    @GetMapping("/getBillList")
    public ApiResponse<List<GetBillListResp>> getBillList() {
        return new ApiResponse<>(billSeeService.getBillList());
    }

    /**
     * 具体账单的查看
     */
    @GetMapping("/getBillDetail")
    public ApiResponse<GetBillDetailResp> getBillDetail(@RequestParam("billId") String billId) {
        return new ApiResponse<>(billSeeService.getBillDetail(billId));
    }

    /**
     * 汇总账单的查看
     */
    @PostMapping("/getSumBill")
    public ApiResponse<GetSumBillResp> getSumBill(@RequestBody List<String> billIds) {
        return new ApiResponse<>(billSeeService.getSumBill(billIds));
    }
}
